package com.sysd.server.handler;

import com.sysd.bean.HeartMessage;
import com.sysd.server.handler.base.AbstractMessageHandler;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Component;

/**
 * @description: 处理客户端的心跳消息
 * @author: bsh
 * @date: 2025/6/13 16:45
 */
@ChannelHandler.Sharable
@Component
public class HeartHandler extends AbstractMessageHandler<HeartMessage> {
    /**
     * 需要子类重写的消息
     *
     * @param ctx 上下文
     * @param msg 消息
     */
    @Override
    public void channelRead1(ChannelHandlerContext ctx, HeartMessage msg) {
        ctx.channel().writeAndFlush(msg);
    }
}
